package com.jf.springloud.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2025-02-27
 * Time:12:51
 */
@RefreshScope
@RequestMapping("/config")
@RestController
public class NacosConfigClientController {
    @Value("${config.ip}")
    private String ip;
    @Value("${config.name}")
    private String name;

    @GetMapping("/getIp")
    public String getIp() {
        System.out.println("ip:" + ip);
        return ip;
    }
    @GetMapping("/getName")
    public String getName() {
        System.out.println("name:" + name);
        return name;
    }
}
